import pygame
import random as r

pygame.init()

class Bullet_supply(pygame.sprite.Sprite):
    def __init__(self,size):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height = size
        self.image1= pygame.image.load('images/bullet_supply.png').convert_alpha()
         
        self.rect = self.image1.get_rect()
        self.rect.left,self.rect.top=r.randint(0,self.width-self.rect.width),\
                                      -100
        self.speed = 5
        self.active =False
        self.mask  = pygame.mask.from_surface(self.image1)
        
    def move(self):
        if self.rect.top <self.height:
            self.rect.top += self.speed
        else:
            self.active = False

    def reset(self):
        self.active = True
        self.rect.left,self.rect.top=r.randint(0,self.width-self.rect.width),\
                                      -100


class Bomp_supply(pygame.sprite.Sprite):
    def __init__(self,size):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height = size
        self.image2= pygame.image.load('images/bomb_supply.png').convert_alpha()
         
        self.rect =self.image2.get_rect()
        self.rect.left,self.rect.top=r.randint(0,self.width-self.rect.width),\
                                      -100
        self.speed = 5
        self.active =False
        self.mask  = pygame.mask.from_surface(self.image2)
        
    def move(self):
        if self.rect.top <self.height:
            self.rect.top += self.speed
        else:
            self.active = False

    def reset(self):
        self.active = True
        self.rect.left,self.rect.top=r.randint(0,self.width-self.rect.width),\
                                      -100
        
        
